package com.ossean.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.ossean.model.EddRelations;
import com.ossean.model.GatherProjectsModel;
import com.ossean.model.OpenSourceProject;

public interface TransferPrjDao {
		//获取edd_relations表中数据
		@Select("select * from ${table} where id>=#{start} and flag =0 limit #{size}")
		public List<EddRelations> getEddRelationList(@Param("table") String table, @Param("start") int start, @Param("size") int size);
		
		@Select("select * from ${table} where id>#{start} and id <= #{end} and flag =0 limit #{size}")
		public List<EddRelations> getEddRelationListInterval(@Param("table") String table, @Param("start") int start,@Param("end") int end, @Param("size") int size);
		
		@Select("select max(id) from ${table}")
		public int selectMaxRelationId(@Param("table") String table);
		
		//更新edd_relations表的osp_id字段
		@Update("update ${table} set osp_id=#{osp_id} where id=#{id}")
		public void updateEddRelationOspId(@Param("table") String table, @Param("id") int id, @Param("osp_id") int osp_id);
		
		//更新edd_relations表的gather_projects_ids字段
		@Update("update ${table} set gather_projects_ids=#{gather_projects_ids} where id=#{id}")
		public void updateEddRelationGatherProjectsIds(@Param("table") String table, @Param("id") int id, @Param("gather_projects_ids") String gather_projects_ids);
		
		
		//读取open_source_projects表中的记录
		@Select("select * from ${table} where id>=#{startId} limit #{size}")
		public List<OpenSourceProject> getOpenSourceProjectList(@Param("table") String table, @Param("startId") int startId, @Param("size") int size);

}
